Skip to content

Add a note about counting leaves in a tree.#3200

Merged
hyanwong merged 2 commits into
tskit-dev:mainfrom
hyanwong:leaf-count-clarification
Jun 8, 2025
Merged

Add a note about counting leaves in a tree.#3200
hyanwong merged 2 commits into
tskit-dev:mainfrom
hyanwong:leaf-count-clarification

Conversation

@hyanwong
Copy link
Copy Markdown
Member

@hyanwong hyanwong commented Jun 8, 2025

I think this is important to state, for the people coming from phylogenetic fields who are looking for a Tree.num_leaves()` method.

@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 8, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.63%. Comparing base (47ef0d5) to head (8017b46).
Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3200   +/-   ##
=======================================
  Coverage   89.63%   89.63%           
=======================================
  Files          28       28           
  Lines       31978    31978           
  Branches     5872     5872           
=======================================
  Hits        28662    28662           
  Misses       1886     1886           
  Partials     1430     1430           
Flag Coverage Δ
c-tests 86.66% <ø> (ø)
lwt-tests 80.38% <ø> (ø)
python-c-tests 88.18% <ø> (ø)
python-tests 98.86% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
python/tskit/trees.py 98.88% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Member

@jeromekelleher jeromekelleher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, one minor thing

Comment thread docs/python-api.md Outdated
Tree.num_tracked_samples

Note that :meth:Tree.num_samples provides an efficient way to count samples under a node
(when sample_lists=True is specified during tree creation). However, samples and leaves
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delete this comment - counting samples is always efficient, sample_lists is something else

Copy link
Copy Markdown
Member Author

@hyanwong hyanwong Jun 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yes, I misunderstood, sorry. Now corrected, and I added another tiny typo correction into the concatenate docs

@hyanwong hyanwong force-pushed the leaf-count-clarification branch 4 times, most recently from b51ba8c to 809ef48 Compare June 8, 2025 17:08
@hyanwong hyanwong force-pushed the leaf-count-clarification branch from 809ef48 to 8017b46 Compare June 8, 2025 17:09
@hyanwong hyanwong added this pull request to the merge queue Jun 8, 2025
Merged via the queue into tskit-dev:main with commit e81ee40 Jun 8, 2025
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants